using UnityEngine;
using System.Collections;

public class Dialogs : MonoBehaviour 
{
	int index;
	public int currentTexture;
	
	public Texture2D[] textures;
	
	GameObject currentDialog;
	
	void Start () 
	{
		index = textures.Length;
	}
	
	void Update () 
	{		
		if(Input.GetMouseButtonDown(0))
		{
			index--;
			
			if(currentTexture != null)
			{
				currentTexture++;
			}
		}
		
		if(index == 0)
		{
			CharacterAnimation_Dialog01.dialogFinished = true;
		}
		
		gameObject.renderer.material.mainTexture = textures[currentTexture];
	}
}
